{extend name="wap@style/base"/}
{block name="resources"}

{/block}
{block name="head"}
<header class="hui-header">
    <div id="hui-back" onclick="window.history.back();"></div>
    <h1>{$title}</h1>
</header>
{/block}
{block name="main"}
<div class="hui-wrap">
    <form style="padding:0px 10px;" class="hui-form" id="form_mobile">
        <div class="hui-form-items">
            <div class="hui-form-items-title">手机号</div>
            <input type="text" class="hui-input hui-input-clear" name="mobile" value="{$member_info.data.mobile}"  placeholder="请填写手机号" checkType="string" checkData="11,11" checkMsg="请填写格式正确的手机号" />
        </div>
    </form>
</div>

<div style="margin-top:28px;">
    <button type="button" class="hui-button hui-button-large" id="submit" style="background:#FFFFFF; " >
        保存
    </button>
</div>

{/block}

{block name="script"}
<script type="text/javascript" src="__STATIC__/ext/hui/js/hui-form.js"></script>
<script>
    hui.formInit();
    //表单验证
    hui('#submit').click(function(){
        var res = huiFormCheck('#form_mobile');
        if(res){
            var data = hui.getFormData('#form_mobile');
            data.access_token = ACCESS_TOKEN;
            nc.api("System.Member.modifyMobile", data, function (res) {
                hui.iconToast(res.message);
                if(res.code == 0){
                    window.history.go(-1);
                }
            }, false);
        }
    });
</script>
{/block}